Allow FileStoreCommit for PK tables with postpone bucket mode#337
Open
liujiayi771 wants to merge 3 commits into
Open
Allow FileStoreCommit for PK tables with postpone bucket mode#337liujiayi771 wants to merge 3 commits into
liujiayi771 wants to merge 3 commits into
Conversation
eb47b05 to
b44744d
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates FileStoreCommit::Create to allow committing primary-key (PK) tables when they use postpone bucket mode (bucket = -2), while still rejecting PK tables configured with fixed buckets (bucket > 0). This aligns commit eligibility with the fact that postpone bucket mode writes into bucket-postpone/ and relies on later compaction to redistribute into real buckets.
Changes:
- Permit
FileStoreCommit::Createfor PK tables whenbucket = -2(postpone bucket mode). - Keep existing behavior (reject) for PK tables with fixed buckets (
bucket > 0). - Add unit tests covering allowed/rejected cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/paimon/core/operation/file_store_commit.cpp |
Adjusts PK-table gating logic to allow postpone bucket mode commits. |
src/paimon/core/operation/file_store_commit_impl_test.cpp |
Adds tests validating postpone-bucket PK commit allowed and fixed-bucket PK commit rejected. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Postpone bucket mode (bucket=-2) writes data like an append table: all files go to bucket--2/ directory and the REST catalog server handles bucket redistribution during background compaction. The commit logic (manifest and snapshot generation) is identical to append tables, so there is no reason to block it. See: https://paimon.apache.org/docs/master/primary-key-table/data-distribution/#postpone-bucket Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Replace raw schema options map lookup with TableSchema::NumBuckets() for postpone bucket check - Use Options::BUCKET constant instead of hardcoded "bucket" in tests - Add IsNotImplemented() status kind assertion in rejection test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2eccc61 to
f9c9267
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FileStoreCommit::Createto proceed for PK tables when using postpone bucket mode (bucket=-2)bucket-postponedirectory of each partition and are not available to readers. To move the records into the correct bucket and make them readable, a compaction job needs to be run (viacompactprocedure or triggered by the catalog server)bucket > 0) remain blocked as beforeTest plan
TestPostponeBucketPKTableCommitAllowed: PK table withbucket=-2→FileStoreCommit::Createsucceeds without workaround flagTestFixedBucketPKTableCommitRejected: PK table withbucket=4→FileStoreCommit::CreatereturnsNotImplementedReference